package com.cn.sl.server.common.exception

import org.springframework.http.HttpStatus

/**
 * 业务异常<br></br>
 * 所有自定义运行时异常都需要继承此类
 */
open class BusinessException(
    override val message: String?,
    cause: Throwable?,
    var code: Int
) : RuntimeException(message, cause) {
    constructor(message: String?, code: HttpStatus) : this(message, null, code.value())
    constructor(message: String?, cause: Throwable?, code: HttpStatus) : this(message, cause, code.value())
    constructor(message: String?, code: Int) : this(message, null, code)
}